package com.woniuxy02;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Test05 {
    public static void main(String[] args) {
        Collection<Student> students=new ArrayList<Student>();
        students.add(new Student("1","zs",11));
        students.add(new Student("2","ls",12));
        students.add(new Student("3","ww",12));
        students.add(new Student("4","zl",12));
        students.add(new Student("5","xxx",12));
        Iterator<Student> iterator = students.iterator();
        while(iterator.hasNext()){
//            Student student = iterator.next();
//            System.out.println(student.getSid());
            System.out.println(iterator.next().getSid());
            System.out.println(iterator.next().getSname());
        }


//        System.out.println(students);
//        for(Student stu:students){
//            System.out.println(stu);
//        }
    }
}
